package fi.tut.tuthelper;

import java.util.ArrayList;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.support.v4.app.NavUtils;

public class Campus extends Activity {
	
	ListView menu;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initial();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_campus, menu);
        return true;
    }
    
    private void initial() {
		// TODO Auto-generated method stub
    	final ArrayAdapter<String> menuAdapter;
        final String[] menuItems = getResources().getStringArray(R.array.campus_menu);
        final ArrayList<String> menuList = new ArrayList<String>();
        //Transfer the menu list content to array list
        for (int i = 0; i < menuItems.length; i++) {
			menuList.add(menuItems[i]);
		}
        menuAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, menuList);
        menu = (ListView) findViewById(R.id.menuList);
        menu.setAdapter(menuAdapter);
	}

    
}
